//业务加载
$(function(){
	//用户登录
	function onLoad(){
		$.ajax({
			type:"post",
			url: ajaxUrl + "/game/1.0/player/loading.js",
			data:{
				token : window.localStorage.getItem('token'),
				jobId : getTimeMs(),
				sid: currentSID,
				gameid: currentSID
			},
			dataType:"json",
			success:function(request){
				console.log(request);
				if(request.code=="0"){
					window.localStorage.setItem('token', request.token);
					//设置图片
					$("#securityCodeImg").attr("src", '/common/1.0/code2?token='+request.token+'&t='+Math.random());
				}				
			},
			error:function(error){
				console.log(error);	
			}
		});
	}	
	
	onLoad();
});

//刷新图片
function securityCodeImgReLoad(){
	var token = window.localStorage.getItem('token');

	$("#securityCodeImg").attr("src", '/common/1.0/code2?token='+token+'&t='+Math.random());
}

